/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cxhd.lis.model.newmodel;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Record;
import java.util.List;

/**
 *
 * @author cxhd
 */
@SuppressWarnings("serial")
public class LisPatientType  extends Model<LisPatientType>{
    
       public static final LisPatientType lisPatientTypedao=new LisPatientType();
     
    public void deletePt(int PK) throws Exception{
        Db.use("mysql").update("delete from lis_patient_type where PK="+PK);

    }
    public void addPt(Controller con) throws Exception{
             set("PTYPENAME", con.getPara("PTYPENAME"))
                .save();
               
    }
    public void updatePt(Controller con){
        System.out.println(con.getPara("PK"));
        findById(con.getPara("PK"))
                .set("PTYPENAME", con.getPara("PTYPENAME"))
                
                .update();
    }
  
}
